package com.kaibes.platform.file.client.db;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

import com.kaibes.core.base.annotation.Description;

import lombok.Data;

/**
CREATE TABLE `file_server` (
  `id` integer NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(256) NOT NULL,
  `priority` TINYINT UNSIGNED NOT NULL DEFAULT 0,
  `host` VARCHAR(128) NOT NULL,
  `user_id` integer NOT NULL,
  `aes_key` CHAR(16) NOT NULL,
  `aes_iv` CHAR(16),
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 */
@Data
@Description("文件服务器信息")
public class FileServer {

	@Description("服务器ID")
    private Integer id;
	@Description("服务器名称")
	private String name;
	@Description("服务器优先级")
	@Min(0)
	@Max(Short.MAX_VALUE)
	private Short priority;
	@Description("文件服务器地址")
	@NotBlank
	private String host;
    @Description("文件服务器用户ID")
    @Min(1)
    private Integer userId;
    @Description("密钥")
    @NotBlank
    private String aesKey;
    @Description("偏移")
    @NotBlank
    private String aesIv;
    
}
